package tech.yunland.shop.web;

import com.moyuer.bsf.web.controller.BaseController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import tech.yunland.shop.domain.service.UserActivityService;

/**
 * 用户积分
 *
 * @author 文卡<wkwenka@gmail.com>  on 17-6-27.
 */
@RestController
@RequestMapping("/userActivity")
public class UserActivityController extends BaseController{

    @Autowired
    private UserActivityService userActivityService;

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String getScore(@RequestParam(required = false) String uid) {

        if (StringUtils.isBlank(uid)){
            uid = this.currentUserId;
        }
        return  this.userActivityService.getActiveScore(uid);
    }
}
